﻿@using System.Diagnostics
@using CMSMVC4
@using CMSMVC4.MultiResource
@if (ViewBag.datav != null && ViewBag.datae != null)
{
    var datav = ViewBag.datav as List<PageLang>;
    var datae = ViewBag.datae as List<PageLang>;
    Debug.Assert(datav != null, "datav != null");
    for (var i = 0; i < datav.Count; i++)
    {
        var home1 = "home1" + i;
        var tabExampleL1 = "tabExample1" + i;
        var homeL1 = "home1" + i;
        var profile1 = "profile1" + i;
        var profileL1 = "profile1" + i;
        var tabExampleL2 = "tabExample2" + i;
        var homeL2 = "home2" + i;
        var profileL2 = "profile2" + i;
        var collapseOne = "collapseOne" + i;
        var collapseTwo = "collapseTwo" + i;
    <hr />
    <input name="tab[@i].idpage" type="hidden" value="@datav[i].PageId" />
    <div class="form-row control-group row-fluid">
        <label class="control-label span3">Ten Tab <span class="help-block">Ten Tab</span> </label>
        <div class="controls span7">
            <input name="tab[@i].namepagev" type="text" value="@datav[i].Name" placeholder="Tieng Viet" style="width: 48%;float: left"/>
            <input name="tab[@i].namepagee" type="text" value="@datae[i].Name" placeholder="English" style="width: 48%;float: right"/>
        </div>
    </div>
    <div  onclick="xoatab(@datav[i].PageId)" class="btn btn-danger btn-large">@Admin.DeleteTab</div>
    <br />
    <br />
    <br />
    
       <div class="accordion" id="accordion2">
        <div class="accordion-group">
            <div class="accordion-heading"><a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion2" href="#@collapseOne">@Admin.Content </a></div>
            <div id="@collapseOne" class="accordion-body collapse" style="height: 0px;">
                <div class="accordion-inner">
                    <ul id="@tabExampleL1" class="nav nav-tabs">
                        <li class="active"><a href="#@homeL1" data-toggle="tab">@Admin.Vietnamese</a></li>
                        <li><a href="#@profileL1" data-toggle="tab">@Admin.English</a></li>
                    </ul>

                    <div class="tab-content">
                        <div class="tab-pane fade in active" id="@homeL1">
                            <div class="form-row control-group row-fluid">
                                <div class="controls span7" style="width: 100%">
                                    <textarea name="tab[@i].fullv" id="fullcontenv_@i" cols="20" rows="2">@datav[i].FullContent</textarea>
                                </div>
                            </div>
                        </div>

                        <div class="tab-pane fade" id="@profileL1">
                            <div class="form-row control-group row-fluid">
                                <div class="controls span7" style="width: 100%">
                                    <textarea name="tab[@i].fulle" id="fullcontene_@i" cols="20" rows="2">@datae[i].FullContent</textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
            <div class="accordion-group">
        <div class="accordion-heading"><a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#@collapseTwo">@Admin.Summary</a></div>

        <div id="@collapseTwo" class="accordion-body collapse" style="height: 0px;">
            <div class="accordion-inner">
                <ul id="@tabExampleL2" class="nav nav-tabs">
                <li class="active"><a href="#@homeL2" data-toggle="tab">@Admin.Vietnamese</a></li>
                <li><a href="#@profileL2" data-toggle="tab">@Admin.English</a></li>
            </ul>

            <div class="tab-content">
                <div class="tab-pane fade in active" id="@homeL2">
                    <div class="form-row control-group row-fluid">
                        <div class="controls span7" style="width: 100%">
                            <textarea name="tab[@i].sumv" id="summanyv_@i" cols="20" rows="2">@datav[i].Summary</textarea>
                        </div>
                    </div>
                </div>

                <div class="tab-pane fade" id="@profileL2">
                    <div class="form-row control-group row-fluid">
                        <div class="controls span7" style="width: 100%">
                            <textarea name="tab[@i].sume" id="summanye_@i" cols="20" rows="2">@datae[i].Summary</textarea>
                        </div>
                    </div>
                </div>
            </div>
            </div>
        </div>
    </div>
    </div>
@*
    @:noi dung full:<br />
    @:noi dung tom tat:<textarea name="tab[@i].sumv" id="summanyv_@i" cols="20" rows="2">@datav[i].Summary</textarea><textarea name="tab[@i].sume" id="summanye_@i" cols="20" rows="2">@datae[i].Summary</textarea><br />*@
    <hr />
    }
    <script type="text/javascript">
        var editor;
        function createEditor(languageCode, id) {
            CKEDITOR.replace(id, {
                language: languageCode
            });
        }
        function loadlisttab() {
            @for (int i = 0; i < datav.Count; i++)
            {
                @:createEditor('vi', 'fullcontenv_@i');
                                        @:createEditor('vi', 'summanyv_@i');
                                        @:createEditor('vi', 'fullcontene_@i');
                                        @:createEditor('vi', 'summanye_@i');
            }
        }
    </script>
}